Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Functions require lists of Feols/Feiv/Fepois object; reject FixestMulti #693 #715

Merged
merged 10 commits into from
Nov 17, 2024

Conversation

IshwaraHegde97
Copy link
Contributor

Added code to convert instances of FixestMulti into lists so that it automatically works with the following functions:

  • pf.bonferroni()
  • pf.rwolf()
  • pf.coefplot()
  • pf.iplot()

Convert FixestMulti to a list so that it works automatically with the following functions:
- pf.bonferroni()
-  pf.rwolf()
- pf.coefplot()
- pf.iplot()
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pyfixest/report/summarize.py 92.30% 1 Missing ⚠️
Flag Coverage Δ
core-tests 77.90% <95.83%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pyfixest/estimation/FixestMulti_.py 80.20% <100.00%> (ø)
pyfixest/estimation/feols_.py 83.27% <100.00%> (+0.03%) ⬆️
pyfixest/estimation/multcomp.py 78.48% <100.00%> (+0.84%) ⬆️
pyfixest/report/visualize.py 55.41% <100.00%> (+0.57%) ⬆️
pyfixest/report/summarize.py 87.27% <92.30%> (+0.27%) ⬆️

@s3alfisc
Copy link
Member

pre-commit.ci autofix

@s3alfisc
Copy link
Member

s3alfisc commented Nov 14, 2024

Hi @IshwaraHegde97, looks very good already! Could you add small API test to test_multcomp.py?

E.g. something like this:

def test_multi_vs_list():

     seed = 1232
    data = pf.get_data()
    fit_all = pf.feols("Y + Y2 ~ X1 + X2", data=data)

    fit1 = pf.feols("Y ~ X1 + X2", data=data)
    fit2 = pf.feols("Y2 ~ X1 + X2", data=data)

    assert bonferroni(fit_all, "X1").equals(bonferroni([fit1, fit2], "X1"))
    assert rwolf(fit_all, "X1", seed = seed).equals(rwolf([fit1, fit2], "X1", seed = seed))

s3alfisc and others added 6 commits November 17, 2024 20:59
Added a test to compare the results when passing a list of Feols/Feiv/Fepois objects vs. a FixestMulti object to bonferroni and rwolf functions.
pixi.lock file was updated
Minor changes for consistency
handle .coefplot() method for FixestMulti, where models is a dict_values instance.
@s3alfisc
Copy link
Member

pre-commit.ci autofix

@s3alfisc
Copy link
Member

@all-contributors please add @IshwaraHegde97 for code

Copy link
Contributor

@s3alfisc

I've put up a pull request to add @IshwaraHegde97! 🎉

@s3alfisc s3alfisc merged commit 712efd9 into py-econometrics:master Nov 17, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants